<?php
class A{

	static $tpl;


	function boot(){
		global $db, $html;
		session_start();
		self::$tpl	= new tpl();
		self::$tpl->assign_by_ref('html', $html);
		self::$tpl->template_dir	= B_DIR . '/_res/';

		$_ENV['referer']	=	$_SERVER['HTTP_REFERER'];
		self::$tpl->assign_by_ref('_ENV', $_ENV);

		if( empty($_GET['mod']) ){ 
			$_GET['mod'] = '_admin';
			$_GET['fun'] = 'info';
			$_GET['act'] = 'info';
		}

		if( U::id() ){
			U::Power();
		}else{
			$_GET['mod']	= '_admin';
			$_GET['fun']	= 'login';
		}
	}


	function msg($msg='错误!', $jurl='', $jump=false, $isa=false){
		global $html;
		if( empty($jurl) ){
			$jurl	= $_SERVER['HTTP_REFERER'] ;
		}
		$_SESSION['$isref']	= 1;
		if($jump){
			$html['jump'] = '<meta http-equiv="Refresh" content="' . $jump . ';URL=' . $jurl . '" />';
		}
		if($isa){
			$msg = '<a href="' . $jurl . '">' . $msg . '</a>';
		}
		self::$tpl->assign('msgs', $msg);
		self::$tpl->display( B_DIR . '/_admin/src/_msg.htm');
		die;
	}

}
A::boot();
?>